
public class BubbleSort
{

    public static int list[] = {10,9,8,7,6,5,4,3,2,1};
    /**
     * @param args
     */
    public  static void printList() {
	for(int i = 0; i< list.length ;i++) {
	    System.out.print(list[i]+" ");
	}
    }
    public static void bubbleSort(int list[]){
	int i = 0;
	while(i <list.length) {
	    for(int j = list.length-1;j > i;j--){
		if(list[j] < list[j-1]) {
		    int temp = list[j];
		    list[j]= list[j-1];
		    list[j-1]=temp;
		}
	    }
	    i++;
	}
    }
    public static void main(String[] args)
    {

	  System.out.println("Before sorting the array ");
	       printList();
	       
		// Now calling the quick sort method here .
	        bubbleSort(list);
	        
	        System.out.println("\nAfter sorting the array ");
	        printList();

    }

}
